package com.cloudspace.jindun.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.cloudspace.jindun.JindunApp;
import com.cloudspace.jindun.dao.LoginUser;
import com.cloudspace.jindun.user.UserSessionManager;

/**
 * Created by zengxianhua on 17/1/8.
 */

public class emptyActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (JindunApp.getInstance().skipFirstPage()){
            LoginUser loginUser = UserSessionManager.getInstance().getCurrentLoginUser();
            JindunApp.getInstance().setUserInfo(loginUser);
            gotoMainActivity();
        }else{
            gotoLoginActivity();
        }

        finish();
    }

    private void gotoLoginActivity() {
        RegisterActivity.showActivity(this);
    }

    private void gotoMainActivity() {
        Intent intent = new Intent();
        intent.setClass(this, MainActivity.class);
        startActivity(intent);
    }
}
